﻿using RealtReview.DataAccess.Entities;
using RealtyReview.Business.Models.ViewModels;

namespace RealtyReview.Business.Mappings
{
    public static partial class EntityMap
    {
        public static Address ToAddress(this AddressViewModel model)
        {
            return new Address
            {
                City = model.City,
                HouseNo = model.HouseNo,
                Housing = model.Housing,
                Latitude = model.Latitude,
                Longitude = model.Longitude,
                Street = model.Street,
                Country = model.Country,
                District = model.District,
                NearestMetro = model.NearestMetro,
            };
        }

        public static AddressViewModel ToAddressViewModel(this Address entity)
        {
            return new AddressViewModel
            {
                City = entity.City,
                HouseNo = entity.HouseNo,
                Housing = entity.Housing,
                Latitude = entity.Latitude,
                Longitude = entity.Longitude,
                Street = entity.Street,
                Country = entity.Country,
                District = entity.District,
                NearestMetro = entity.NearestMetro,
            };
        }
    }
}
